<%@ page language="java" import="java.util.* , cn.edu.hust.youth.tzb.model.*" pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
/*
Student s=new Student();
s=(Student)session.getAttribute("STUDENT");
if(s==null){
	response.sendRedirect("/student/unlogin.jsp");
}
*/
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'chechup.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<br>
		<%
			String message = (String)request.getAttribute("message");
			out.println(message);
			
			ArrayList works = (ArrayList)request.getAttribute("works");
			int i = 0 ;
		 %>
		<table width="200" border="1">
			<tbody>
				<tr>
					<td>
						序号
					</td>
					<td>作品题目</td>
					<td colspan="3">
						操作
					</td>
				</tr>
				<%
					while ( !works.isEmpty() )
					{
						Work w = (Work)works.get(i);
						works.remove(i);
						i = i++;
						%>
				<tr>
					<td>
				<%
						out.println(w.getName());
						out.println("</td>");
						out.println("<td>");
						out.println(w.getType());
						out.println("</td>");
						%>
						<td>
							<a href="/checkWork/modifywork?id=<%= w.getId() %>"/>修改
						</td>
						<td>
							<a href="/checkWork/checkwork?id=<%= w.getId() %>"/>审批
						</td>
						<td>
							<a href="/checkWork/delteWork?id=<%= w.getId() %>"/>删除
						</td>
						<%
					} 
				%>
				</tr>
			</tbody>
		</table>
		<br/>
		<a href="http://localhost/inputwork/inputWork.jsp">添加作品</a>
	</body>
</html>
